package com.cy.sqlSession;

import java.beans.IntrospectionException;
import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.List;

public interface SqlSession {

    /**
     * 查询所有
     * @param <E>
     * @return
     */
    <E> List<E> selectList(String statementId, Object... params) throws SQLException, IntrospectionException, NoSuchFieldException, InvocationTargetException, IllegalAccessException, InstantiationException;

    /**
     * 查询一个
     * @param params
     * @param <T>
     * @return
     */
    <T> T selectOne(String statementId, Object... params) throws SQLException, IntrospectionException, NoSuchFieldException, InvocationTargetException, IllegalAccessException, InstantiationException;

    <T> int insert(String statementId, Object... object) throws SQLException, NoSuchFieldException, IllegalAccessException;

    <T> int update(String statementId, Object... object) throws SQLException, NoSuchFieldException, IllegalAccessException;

    <T> int delete(String statementId, Object... object) throws SQLException, NoSuchFieldException, IllegalAccessException;

    <T> T getMapper(Class<?> mapperClass);

}
